/*
 * @Author       : 邱狮杰
 * @Date         : 2021-05-08 14:26:18
 * @LastEditTime : 2021-05-08 16:23:46
 * @FilePath     : /abc/js/examResult.js
 * @Description  : 考试结果.js
 */
$(function () {
  $('.examResultPageModelMain').css('height', $('.examResultPageModelMain').css('height'))
  $('.examResultPageComments').click(function () {
    const teacherCommentsModelContainer = $('.examResultPageModelMain')
    const curChildImg = $(this).children('img')
    if (teacherCommentsModelContainer.css('height') !== '0px') {
      curChildImg.css('transform', 'rotate(270deg)')
      teacherCommentsModelContainer.css('height', 0)
    } else {
      curChildImg.css('transform', 'rotate(90deg)')
      teacherCommentsModelContainer.css('height', teacherCommentsModelContainer[0].scrollHeight + 'px')
    }
  })
  $('.startList').click(function (e) {
    const allImg = Array.from(e.target.parentNode.children).filter(ele => ele.tagName === 'IMG')
    const choseImgEle = allImg.filter(ele => parseInt($(ele).attr('data-index')) <= parseInt($(e.target).attr('data-index')))
    allImg.forEach(item => $(item).attr('src', './assets/noStart.png'))
    choseImgEle.forEach(item => $(item).attr('src', './assets/start.png'))
  })
})
